#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct student
{
    char name[2000];
    int age;
};

void prints_student(struct student st)
    //st是形参，调用函数的时候，在栈里面有一个浅拷贝的过程st = s
{
    printf("st.name = %s, st.age = %d", st.name, st.age);
}

void prints_student_new(const struct student *st)
    //st = &s;
    //效率远远高于上一个操作
{
    printf("st->name = %s, st->age = %d", st->name, st->age);
}
void set_student(struct student *st)
    //实参的值给形参，形参的值改变后不会影响形参
    //只能传递地址才会改变
{
    strcpy(st->name, "123456");
    st->age = 10;
}

int main()
{
    struct student s = {"abc", 40};
    set_student(&s);//s的值在函数调用完成后会改变么
    prints_student_new(&s);
    return 0;
}

